﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for ShiftBLL
/// </summary>
public class ShiftBLL:IShiftBLL
{
    //inject DAL
    private IShiftDAL shiftDAL = Factory<IShiftDAL>.CreateInstance();


	public ShiftBLL()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public List<Shift> GetAll()
    {
        try
        {
            return shiftDAL.GetAll();
        }
        catch (Exception)
        {
            throw;
        }
    }

    public List<Shift> GetShiftActive()
    {
        try
        {
            return shiftDAL.GetShiftActive();
        }
        catch (Exception)
        {
            throw;
        }
    }

    public DataTable LoadGrantShiftByEmployee(Guid id, DateTime monthYear)
    {
        try
        {
            return shiftDAL.LoadGrantShiftByEmployee(id,monthYear);
        }
        catch (Exception)
        {
            throw;
        }
    }

    public bool Save(List<Shift> list)
    {
        try
        {
            return shiftDAL.Save(list);
        }
        catch (Exception)
        {
            throw;
        }
    }

    public bool GrantShift(List<EmployeeShift> empShift)
    {
        try
        {
            return shiftDAL.GrantShift(empShift);
        }
        catch (Exception)
        {
            throw;
        }
    }



}